#ifndef POINT_H
#define POINT_H

#include <iostream>

class point
{
    public:
        point();
        point(double x, double y);

        bool operator==(const point &p) const;
        bool operator!=(const point &p) const;

        point &operator+=(const point &p);
        point &operator-=(const point &p);

        point operator+(const point &p) const;
        point operator-(const point &p) const;

        double x, y;
};

class point_comparator
{
    public:
        enum type
        {
            X, Y
        };

        point_comparator(type t = X): t(t)
        {
        }

        bool operator()(const point &a, const point &b) const;
    private:
        type t;
};

std::istream &operator>>(std::istream &is, point &p);
std::ostream &operator<<(std::ostream &os, const point &p);

#endif
